import React, {useEffect} from 'react';
import {observer} from 'mobx-react';
import {useParams} from 'react-router-dom'
import Table from './Table';
import store from './store';

export default observer(function (props) {
  // const type = props.match.params.type
  // 获取路由汇总的参数type
const type= useParams().type
  console.log('Props.match=', type)
  // const type = new URLSearchParams(window.location.search).get('type');
  useEffect(() => {
    type && store.fetchRecords(type)
  }, [type])

  return (
    <React.Fragment>
      <Table/>
    </React.Fragment>
  )
})